package xyz.sicau.blog.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
@ConfigurationProperties(prefix = "blog")
@NoArgsConstructor
@AllArgsConstructor
@Data
public class Blog {
    private int blogId;
    private String blogTittle;
    private String blogContent;
    private String blogUserid;
    private String blogUsername;
    private Date blogTime;
    private String blogLabel;
    private String blogData;
    private String blogType;
    private String blogInfo;

    public Blog(String blogTittle, String blogContent, String blogUserid, String blogUsername, Date blogTime, String blogLabel, String blogData) {
        this.blogTittle = blogTittle;
        this.blogContent = blogContent;
        this.blogUserid = blogUserid;
        this.blogUsername = blogUsername;
        this.blogTime = blogTime;
        this.blogLabel = blogLabel;
        this.blogData = blogData;
    }

    // 多了个 type属性
    public Blog(String blogTittle, String blogContent, String blogUserid, String blogUsername, Date blogTime, String blogLabel, String blogData, String blogType) {
        this.blogTittle = blogTittle;
        this.blogContent = blogContent;
        this.blogUserid = blogUserid;
        this.blogUsername = blogUsername;
        this.blogTime = blogTime;
        this.blogLabel = blogLabel;
        this.blogData = blogData;
        this.blogType = blogType;
    }
}
